const key = "userInfo";

export const setUserInfo = <T>(userInfo: T): void => {
   localStorage.setItem(key, JSON.stringify(userInfo));
};


export const getUserInfo = <T>(): T | {} | null => {
   try {
      return JSON.parse(localStorage.getItem(key) as any);
   } catch (error: any) {
      return {};
   }
};

export const removeUserInfo = (): void => {
   localStorage.removeItem(key);
};
